<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Date &amp; time</title>
<link rel="stylesheet" href="/cfg/format.css" type="text/css">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="keywords" content="Windows API, Winapi, Win32, C, date &amp; time">
<meta name="description" content="In this part of the Winapi tutorial, we 
will work date &amp; time.">
<meta name="language" content="en">
<meta name="author" content="Jan Bodnar">
<meta name="distribution" content="global">

<script type="text/javascript" src="/lib/jquery.js"></script>
<script type="text/javascript" src="/lib/common.js"></script>

</head>

<body>

<div class="container2">

<div id="wide_ad" class="ltow">
<script type="text/javascript"><!--
google_ad_client = "pub-9706709751191532";
/* 160x600, August 2011 */
google_ad_slot = "2484182563";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>

<div class="content2">


<a href="/" title="Home">Home</a>&nbsp;
<a href="..">Contents</a>


<h1>Date &amp; time</h1>


<p>
In this part of the Windows API tutorial, we will work with date and
time. 
</p>

<div class="big_hor">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-9706709751191532";
/* big_horizontal */
google_ad_slot = "2904953388";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>

<p>
The <code>SYSTEMTIME</code> structure is used to work with date and time
in Windows API. The time can be either coordinated universal time (UTC) 
or local time. It has the following members:
</p>

<pre>
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
</pre>

<p>
The <code>SYSTEMTIME</code> structure is filled either with the 
<code>GetSystemTime()</code> function or the <code>GetLocalTime()</code> 
function. We can then access the members of the structure to get the current
date or time.
</p>

<p>
The <code>FILETIME</code> structure contains a 64-bit value representing the 
number of 100-nanosecond intervals since January 1, 1601 (UTC). With this value 
we are able to compute the Windows API epoch or the datetime differences.
</p>

<pre>
DWORD dwLowDateTime;
DWORD dwHighDateTime;
</pre>

<p>
The <code>FILETIME</code> structure has two members. The 
<code>dwLowDateTime</code> is the low-order part of the file time. And the 
<code>dwHighDateTime</code> is the high-order part of the file time. To get a 
single value from the two members, we utilize the <code>LARGE_INTEGER</code> 
union.
</p>

<p>
The <code>FileTimeToSystemTime()</code> and the 
<code>SystemTimeToFileTime()</code> functions are used to convert between the
two structures.
</p>


<h2>Local time</h2>

<p>
Local time is defined as the current time in the user's time zone.
</p>

<pre class="code">
#include &lt;windows.h&gt;
#include &lt;wchar.h&gt;

int wmain(void)
{
  SYSTEMTIME lt;
  
  GetLocalTime(&amp;lt);
  
  wprintf(L"The local time is: %02d:%02d:%02d\n", 
    lt.wHour, lt.wMinute, lt.wSecond);

  return 0;
}
</pre>

<p>
The program prints the local time. 
</p>

<pre class="explanation">
SYSTEMTIME lt;
</pre>

<p>
We declare the <code>SYSTEMTIME</code> structure. The members of this structure
are filled by calling a specific time function.
</p>

<pre class="explanation">
GetLocalTime(&amp;lt);
</pre>

<p>
The <code>GetLocalTime()</code> retrieves the current local date and time.
It fills the members of the <code>SYSTEMTIME</code> structure with current 
date &amp; time values. 
</p>

<pre class="explanation">
wprintf(L"The local time is: %02d:%02d:%02d\n", 
  lt.wHour, lt.wMinute, lt.wSecond);
</pre>

<p>
We print the current local time in the hh:mm:ss format. 
</p>

<pre>
C:\winapi\examples2\datetime\LocalTime>LocalTime.exe
The local time is: 13:23:19
</pre>

<p>
Sample output.
</p>


<h2>UTC time</h2>

<p>
Our planet is a sphere. It revolves round its axis. The Earth rotates towards 
the east. So the Sun rises at different times in different locations. The Earth 
rotates once in about 24 hours. Therefore, the world was divided into 24 time 
zones. In each time zone, there is a different local time. This local time is 
often further modified by the daylight saving. 
</p>

<p>
There is a pragmatic need for one global time. One global time helps to avoid 
confusion about time zones and daylight saving time. The UTC 
(Universal Coordinated time) was chosen to be the primary time standard. 
UTC is used in aviation, weather forecasts, flight plans, air traffic control 
clearances and maps. Unlike local time, UTC does not change with a change of 
seasons.
</p>

<p>
The Windows API has the <code>GetSystemTime()</code> function to get the 
UTC time. 
</p>

<pre class="code">
#include &lt;windows.h&gt;
#include &lt;wchar.h&gt;

int wmain(void)
{
  SYSTEMTIME st;
  
  GetSystemTime(&st);
  
  wprintf(L"The system time is: %02d:%02d:%02d\n", 
    st.wHour, st.wMinute, st.wSecond);

  return 0;
}
</pre>

<p>
In the example we compute the UTC time.
</p>

<pre class="explanation">
SYSTEMTIME st;
</pre>

<p>
The UTC time will be stored in the <code>SYSTEMTIME</code> structure.
</p>

<pre class="explanation">
GetSystemTime(&st);
</pre>

<p>
We retrive the UTC time using the <code>GetSystemTime()</code> function.
</p>

<pre class="explanation">
wprintf(L"The system time is: %02d:%02d:%02d\n", 
  st.wHour, st.wMinute, st.wSecond);
</pre>

<p>
The UTC time is printed to the console in the hh:mm:ss format.
</p>

<pre>
C:\winapi\examples2\datetime\SystemTime>SystemTime.exe
The system time is: 21:11:13
</pre>

<p>
Output.
</p>


<h2>Date</h2>

<p>
The <code>GetLocalTime()</code> function is also used to determine the
current date.  
</p>

<pre class="code">
#include &lt;windows.h&gt;
#include &lt;wchar.h&gt;

int wmain(void)
{
  SYSTEMTIME st;
  
  GetLocalTime(&st);
  
  wprintf(L"Today is: %d-%02d-%02d\n", st.wYear, st.wMonth, st.wDay);

  return 0;
}
</pre>

<p>
The above program prints today's date.
</p>

<pre class="explanation">
SYSTEMTIME st;
</pre>

<p>
We declare a <code>SYSTEMTIME</code> structure. 
</p>

<pre class="explanation">
GetLocalTime(&st);
</pre>

<p>
We fill the <code>SYSTEMTIME</code> members with current local time and date
values.
</p>

<pre class="explanation">
wprintf(L"Today is: %d-%02d-%02d\n", st.wYear, st.wMonth, st.wDay);
</pre>

<p>
The current date is printed to the console. We have chosen the Gregoriand
big-endian date format.
</p>

<pre>
C:\winapi\examples2\datetime\Today>Today.exe
Today is: 2012-10-07
</pre>

<p>
Output of the program.
</p>


<h2>Determining a leap year</h2>

<p>
A <b>leap year</b> is a year containing an additional day. The reason for an 
extra day in the calendar is the difference between the astronomical and the 
calendar year. The calendar year has exactly 365 days, while the astronomical 
year, the time for the earth to make one revolution around the Sun, is 365.25 
days. The difference is 6 hours which means that in four years time we are 
missing one day. Because we want to have our calendar synchronized with the 
seasons, we add one day to February each four years. (There are exceptions.) 
In the Gregorian calendar, February in a leap year has 29 days instead of the 
usual 28. And the year lasts 366 days instead of the usual 365.
</p>


<pre class="code">
#include &lt;windows.h&gt;
#include &lt;stdbool.h&gt;
#include &lt;wchar.h&gt;

bool isLeapYear(int);

int wmain(void)
{
  int years[] = { 2000, 2002, 2004, 2008, 2012,
    1900, 1800, 1600, 1200, 1000 };
  
  int size = sizeof(years)/sizeof(int);

  for (int i=0; i&lt;size; i++)
  {
    if (isLeapYear(years[i])) 
    {
      wprintf(L"%ld is a leap year\n", years[i]);
    } else {
      wprintf(L"%ld is not a leap year\n", years[i]);
    }
  }

  return 0;
}

bool isLeapYear(int year)
{
  if ((year % 100 == 0) &amp;&amp; (year % 400 == 0)) {
    return true;
  }
 
  if ((year % 4 == 0) &amp;&amp; (year % 100 !=0)) {
    return true;
  }

  return false;
}
</pre>

<p>
We have an array of years. We check all years if they are leap years or
not. There is no built-in function to check for a leap year. We have
created a custom <code>isLeapYear()</code> function. 
</p>

<pre class="explanation">
int years[] = { 2000, 2002, 2004, 2008, 2012,
  1900, 1800, 1600, 1200, 1000 };
</pre>

<p>
This is an array of years that we will check.
</p>

<pre class="explanation">
for (int i=0; i&lt;size; i++)
{
  if (isLeapYear(years[i])) 
  {
    wprintf(L"%ld is a leap year\n", years[i]);
  } else {
    wprintf(L"%ld is not a leap year\n", years[i]);
  }
}
</pre>

<p>
With the for loop we traverse the array. We check if a year is a leap 
year using the <code>isLeapYear()</code> function.
</p>

<pre class="explanation">
bool isLeapYear(int year)
{
  if ((year % 100 == 0) &amp;&amp; (year % 400 == 0)) {
    return true;
  }
 
  if ((year % 4 == 0) &amp;&amp; (year % 100 !=0)) {
    return true;
  }

  return false;
}
</pre>

<p>
This is the function for determining a leap year. Leap years are integer 
multiples of 4. A year that is an integer multiple of 100 is not a leap year, 
unless it is also an integer multiple of 400, in which case it is also a leap
year.
</p>

<pre>
C:\winapi\examples2\datetime\LeapYear>LeapYear.exe
2000 is a leap year
2002 is not a leap year
2004 is a leap year
2008 is a leap year
2012 is a leap year
1900 is not a leap year
1800 is not a leap year
1600 is a leap year
1200 is a leap year
1000 is not a leap year
</pre>

<p>
Output of the LeapYear.exe program.
</p>


<h2>Uptime</h2>

<p>
The <code>GetTickCount()</code> function can be used to get the uptime of a
computer. It retrieves the number of milliseconds that have elapsed since 
the system has started. 
</p>

<pre>
DWORD WINAPI GetTickCount(void);
</pre>

<p>
The function returns a DWORD value, so the maximum number of days returned is 
49.7. To get over this limitation, we can use the <code>GetTickCount64()</code>. 
(Available from Windows Vista). 
</p>

<pre class="code">
#include &lt;windows.h&gt;
#include &lt;wchar.h&gt;

int wmain(void) 
{  
  DWORD tc = GetTickCount();

  short seconds = tc / 1000 % 60; 
  short minutes = tc / 1000 / 60 % 60; 
  short hours = tc / 1000 / 60 / 60 % 24; 
  short days = tc / 1000 / 60 / 60 / 24 % 7;  
  short weeks = tc / 1000 / 60 / 60 / 24 / 7 % 52; 

  wprintf(L"Computer has been running for: ");
                    
  if (weeks > 0 && weeks != 1) {
    wprintf(L"%hi weeks ", weeks);
  } else if (weeks == 1) {
    wprintf(L"1 week ");
  }

  if (days > 0 && days != 1) {
    wprintf(L"%hi days ", days);
  } else if (days == 1) {
    wprintf(L"1 day ");
  }

  if (hours > 0 && hours != 1) {
    wprintf(L"%hi hours ", hours);
  } else if (hours == 1) {
    wprintf(L"1 hour ");
  }

  if (minutes > 0 && minutes != 1) {
    wprintf(L"%hi minutes ", minutes); 
  } else if (minutes == 1) {
    wprintf(L"1 minute ");
  }

  wprintf(L"and %hi seconds\n", seconds);
  
  return 0;
}
</pre>

<p>
The program prints the uptime of a computer. We use the 
<code>GetTickCount()</code> function. It works correctly if the
computer is running less than 49.71 days or 4294967296 ms. After that the
DWORD value overflows. 
</p>

<pre class="explanation">
DWORD tc = GetTickCount();
</pre>

<p>
We get the number of milliseconds the computer is running. The maximum
number a DWORD variable can store is <code>ULONG_MAX</code>.
</p>

<pre class="explanation">
short seconds = tc / 1000 % 60; 
short minutes = tc / 1000 / 60 % 60; 
short hours = tc / 1000 / 60 / 60 % 24; 
short days = tc / 1000 / 60 / 60 / 24 % 7;  
short weeks = tc / 1000 / 60 / 60 / 24 / 7 % 52; 
</pre>

<p>
We compute the seconds, minutes, hours, days and weeks. 
</p>


<pre class="explanation">
if (weeks > 0 && weeks != 1) {
  wprintf(L"%hi weeks ", weeks);
} else if (weeks == 1) {
  wprintf(L"1 week ");
}
</pre>

<p>
If the computer is running one or more weeks, we either print the weeks variable
or "1 week" string to the console. 
</p>

<pre>
C:\winapi\examples2\datetime\Uptime>Uptime.exe
Computer has been running for: 3 hours 31 minutes and 7 seconds
</pre>

<p>
Sample output.
</p>


<h2>Day of week</h2>

<p>
The <code>wDayOfWeek</code> member of the <code>SYSTEMTIME</code> structure
stores the day of the week. The values are 1..7 where 1 is Sunday, 2 Monday,...
7 Saturday.
</p>

<pre class="code">
#include &lt;windows.h&gt;
#include &lt;wchar.h&gt;

int wmain(void)
{
  SYSTEMTIME st;

  wchar_t *dn[] =  {L"Sunday", L"Monday", L"Tuesday", 
    L"Wednesday", L"Thursday", L"Friday", L"Saturday"};

  GetLocalTime(&st);
  wprintf(L"Today is %ls\n", dn[st.wDayOfWeek]);

  return 0;
}
</pre>

<p>
The code prints the current day of the week to the console. 
</p>

<pre class="explanation">
wchar_t *dn[] =  {L"Sunday", L"Monday", L"Tuesday", 
  L"Wednesday", L"Thursday", L"Friday", L"Saturday"};
</pre>

<p>
We store the names of the days in a string array.
</p>

<pre class="explanation">
GetLocalTime(&st);
wprintf(L"Today is %ls\n", dn[st.wDayOfWeek]);
</pre>

<p>
These lines retrieve and print the current day of the week.
</p>

<pre>
C:\winapi\examples2\datetime\WeekDay>WeekDay.exe
Today is Tuesday
</pre>

<p>
Output.
</p>


<h2>The epoch</h2>

<p>
An epoch is an instant in time chosen as the origin of a particular era. 
For example in western Christian countries the time epoch starts from day 0, 
when Jesus was born (is believed to be born). Another example is the French 
Republican Calendar which was used for twelve years. The epoch was the beginning 
of the Republican Era which was proclaimed on September 22, 1792, the day the 
First Republic was declared and the monarchy abolished. Computers have their 
epochs too. One of the most popular is the Unix time. The Unix epoch is the 
time 00:00:00 UTC on 1 January 1970 (or 1970-01-01T00:00:00Z ISO 8601). The date 
and time in a computer is determined according to the number of seconds or clock 
ticks that have elapsed since the defined epoch for that computer or platform.
</p>

<p>
Windows operating system has several epochs. Microsoft Excel, MS SQL Server
or FAT32 filesystem have different time epochs. The Windows API epoch is
January 1, 1601, 00:00:00 UTC. The reason for choosing this date was the 400th
anniversary of accepting of the Gregorian calendar. The anniversary falled at 
the time when Windows NT was designed. The <code>FILETIME</code> structure 
contains a 64-bit value representing the number of 100-nanosecond intervals 
since January 1, 1601 (UTC).
</p>

<pre class="code">
#include &lt;windows.h&gt;
#include &lt;wchar.h&gt;

int wmain(void)
{
  FILETIME ft;
  
  GetSystemTimeAsFileTime(&ft);

  LARGE_INTEGER li;    

  li.LowPart = ft.dwLowDateTime;
  li.HighPart = ft.dwHighDateTime;

  long long int hns = li.QuadPart;
    
  wprintf(L"%lli hundreds of nanoseconds have elapsed " 
    "since Windows API epoch\n", hns);

  return 0;
}
</pre>

<p>
The code example computes the number of 100-nanosecond intervals elapsed from
the Windows API epoch till this moment. 
</p>

<pre class="explanation">
FILETIME ft;
</pre>

<p>
We declare the <code>FILETIME</code> structure. It has two members. The 
<code>dwLowDateTime</code> holds the low-order part of the file time. The 
<code>dwHighDateTime</code> holds the high-order part of the file time.
</p>

<pre class="explanation">
LARGE_INTEGER li; 
</pre>

<p>
The <code>LARGE_INTEGER</code> is a union which helps us to convert the 
members of the <code>FILETIME</code> structure to 100-nanosecond intervals.
</p>

<pre class="explanation">
li.LowPart = ft.dwLowDateTime;
li.HighPart = ft.dwHighDateTime;
</pre>

<p>
The values of the <code>FILETIME</code> structure are copied to the large
integer union members.
</p>

<pre class="explanation">
long long int hns = li.QuadPart;
</pre>

<p>
The <code>QuadPart</code> member stores the number of hundreds of nanoseconds
determined from the <code>LowPart</code> and <code>HighPart</code> members.
It is a huge number stored as a 64-bit integer. 
</p>

<pre class="explanation">
wprintf(L"%lli hundreds of nanoseconds have elapsed " 
  "since Windows API epoch\n", hns);
</pre>

<p>
The value is printed to the console. 
</p>

<pre>
C:\winapi\examples2\datetime\Epoch>Epoch.exe
129939979517540965 hundreds of nanoseconds have elapsed since Windows API epoch
</pre>

<p>
Sample output.
</p>


<h2>Days until XMas</h2>

<p>
The Windows API does not have any functions to calcuate the difference between
two days. We have to do the math ourselves. 
</p>

<pre class="code">
#include &lt;windows.h&gt;
#include &lt;stdbool.h&gt;
#include &lt;wchar.h&gt;

int wmain(void)
{
  FILETIME ft1;
  FILETIME ft2;
  SYSTEMTIME st = {0};  
  LARGE_INTEGER li1;    
  LARGE_INTEGER li2; 

  st.wYear = 2012;
  st.wMonth = 12;
  st.wDay = 25;

  bool r = SystemTimeToFileTime(&st, &ft1);

  if (!r) {
    wprintf(L"Failed to convert system time to file time\n (%d)", 
      GetLastError());
    return 1;
  }
  
  GetSystemTimeAsFileTime(&ft2);
   
  li1.LowPart = ft1.dwLowDateTime;
  li1.HighPart = ft1.dwHighDateTime;

  li2.LowPart = ft2.dwLowDateTime;
  li2.HighPart = ft2.dwHighDateTime;

  long long int dif = li1.QuadPart - li2.QuadPart;

  int days2xmas = dif / 10000000L / 60 / 60 / 24;

  if (days2xmas == 1) {
    wprintf(L"There is one day until Christmas\n", days2xmas);
  } else if (days2xmas == 0) {
    wprintf(L"Today is Chritmas");
  } else {
    wprintf(L"There are %d days until Christmas\n", days2xmas);
  }
  
  return 0;
}
</pre>

<p>
The code example computes the number of days until the Christmas. 
</p>

<pre class="explanation">
FILETIME ft1;
FILETIME ft2;
SYSTEMTIME st = {0};  
LARGE_INTEGER li1;    
LARGE_INTEGER li2;
</pre>

<p>
We need <code>FILETIME</code>, <code>SYSTEMTIME</code> structures and 
<code>LARGE_INTEGER</code> unions to do our computations.
</p>

<pre class="explanation">
st.wYear = 2012;
st.wMonth = 12;
st.wDay = 25;
</pre>

<p>
The <code>SYTEMTIME</code> structure is filled with the values for the 
Christmas day.
</p>

<pre class="explanation">
bool r = SystemTimeToFileTime(&st, &ft1);
</pre>

<p>
The system time for the Christmas day is converted to file time. 
</p>

<pre class="explanation">
GetSystemTimeAsFileTime(&ft2);
</pre>

<p>
We get the current date as a file time using the 
<code>GetSystemTimeAsFileTime()</code> function.
</p>

<pre class="explanation">
li1.LowPart = ft1.dwLowDateTime;
li1.HighPart = ft1.dwHighDateTime;

li2.LowPart = ft2.dwLowDateTime;
li2.HighPart = ft2.dwHighDateTime;
</pre>

<p>
We fill the two unions with the low-order and high-order parts of the file time.
</p>

<pre class="explanation">
long long int dif = li1.QuadPart - li2.QuadPart;
</pre>

<p>
The difference between the two dates is computed. 
</p>

<pre class="explanation">
int days2xmas = dif / 10000000L / 60 / 60 / 24;
</pre>

<p>
The difference is expressed in 100-nanoseconds. This value is converted to 
days. 
</p>

<pre>
C:\winapi\examples2\datetime\DaysToXMas>DaysToXMas.exe
There are 79 days until Christmas
</pre>

<p>
Output.
</p>


<h2>Comparing times</h2>

<p>
The <code>CompareFileTime()</code> function can be used to compare two file
times. The function returns -1 when the first time specified is earlier.
It returns 0, when the two times are equal. And it returns 1 when the first
time is later than the second file time.
</p>

<pre class="code">
#include &lt;windows.h&gt;
#include &lt;stdbool.h&gt;
#include &lt;wchar.h&gt;

int wmain(void)
{
  SYSTEMTIME st1 = {0};
  SYSTEMTIME st2 = {0};
  FILETIME ft1;
  FILETIME ft2;

  st1.wYear = 2012;
  st1.wMonth = 4;
  st1.wDay = 12;

  st2.wYear = 2012;
  st2.wMonth = 5;
  st2.wDay = 12;

  bool r1 = SystemTimeToFileTime(&st1, &ft1);

  if (!r1) {
    wprintf(L"Failed to convert system time to file time\n (%d)", 
      GetLastError());
    return 1;
  }
  
  bool r2 = SystemTimeToFileTime(&st2, &ft2);

  if (!r2) {
    wprintf(L"Failed to convert system time to file time\n (%d)", 
      GetLastError());
    return 1;
  }
    
  short ct = CompareFileTime(&ft1, &ft2);

  if (ct == -1) {
    wprintf(L"4/12/2012 comes before 5/12/2012\n");
  } else if (ct == 0) {
    wprintf(L"4/12/2012 is equal to 5/12/2012\n");
  } else if (ct == 1) {
    wprintf(L"4/12/2012 comes after 5/12/2012\n");
  }

  return 0;
}
</pre>

<p>
We define two times. We use the <code>CompareFileTime()</code> to figure out
which time is earlier than the other one.
</p>

<pre class="explanation">
st1.wYear = 2012;
st1.wMonth = 4;
st1.wDay = 12;

st2.wYear = 2012;
st2.wMonth = 5;
st2.wDay = 12;
</pre>

<p>
The two times are defined.
</p>

<pre class="explanation">
bool r1 = SystemTimeToFileTime(&st1, &ft1);

if (!r1) {
  wprintf(L"Failed to convert system time to file time\n (%d)", 
    GetLastError());
  return 1;
}

bool r2 = SystemTimeToFileTime(&st2, &ft2);

if (!r2) {
  wprintf(L"Failed to convert system time to file time\n (%d)", 
    GetLastError());
  return 1;
}
</pre>

<p>
The system times are converted to file times using the 
<code>SystemTimeToFileTime()</code> function calls.
</p>

<pre class="explanation">
short ct = CompareFileTime(&ft1, &ft2);
</pre>

<p>
The two file times are compared with the <code>CompareFileTime()</code> 
function.
</p>

<pre class="explanation">
if (ct == -1) {
  wprintf(L"4/12/2012 comes before 5/12/2012\n");
} else if (ct == 0) {
  wprintf(L"4/12/2012 is equal to 5/12/2012\n");
} else if (ct == 1) {
  wprintf(L"4/12/2012 comes after 5/12/2012\n");
}
</pre>

<p>
Depending on the returned value, we print a message.
</p>

<pre>
C:\winapi\examples2\datetime\CompareTime>CompareTime.exe
4/12/2012 comes before 5/12/2012
</pre>

<p>
Output.
</p>

                                                          
<p>
In this part of the Winapi tutorial, we have worked with date &amp; time.
</p>


<div class="center"> 
<script type="text/javascript"><!--
google_ad_client = "pub-9706709751191532";
/* horizontal */
google_ad_slot = "1734478269";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script> 
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
</script> 
</div> 
<br> 


<div class="botNav, center">
<span class="botNavItem"><a href="/">Home</a></span> ‡ <span class="botNavItem"><a href="..">Contents</a></span> ‡
<span class="botNavItem"><a href="#">Top of Page</a></span>
</div>


<div class="footer">
<div class="signature">
<a href="/">ZetCode</a> last modified October 7, 2012  <span class="copyright">&copy; 2007 - 2013 Jan Bodnar</span>
</div>
</div>

</div> <!-- content -->

</div> <!-- container -->

</body>
</html>
